package cn.wenhe9.yygh.hosp.repository;

import cn.wenhe9.yygh.model.hosp.Schedule;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.mongodb.repository.MongoRepository;
import org.springframework.stereotype.Repository;

import java.util.Date;
import java.util.List;
import java.util.Optional;

/**
 * @author DuJinliang
 * 2022/3/28
 */
@Repository
public interface ScheduleRepository extends MongoRepository<Schedule, String> {
    Optional<Schedule> findScheduleByHoscodeAndHosScheduleIdAndIsDeletedEquals(String hoscode, String hosScheduleId, int isDeleted);

    Optional<Schedule> findScheduleByHoscodeAndHosScheduleId(String hoscode, String depcode);

    Page<Schedule> findSchedulesByHoscodeAndIsDeletedEquals(String hoscode, Pageable pageable, int isDeleted);

    List<Schedule> findSchedulesByHoscodeAndDepcodeAndWorkDate(String hoscode, String depcode, Date workDate);
}
